# Maintainer: Johannes Schindelin <johannes.schindelin@gmx.de>

_realname=connect
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.105
tag='e122d9bd28e1'
pkgrel=1
pkgdesc="Make socket connection using SOCKS4/5 and HTTP tunnel (mingw-w64)"
arch=('any')
license=('GPL2+')
url="https://bitbucket.org/gotoh/connect/overview"
options=('strip')
source=(${_realname}-${pkgver}.tar.bz2::"https://bitbucket.org/gotoh/${_realname}/get/${pkgver}.tar.bz2")
sha256sums=('07366026b1f81044ecd8da9b5b5b51321327ecdf6ba23576271a311bbd69d403')

build() {
  cd "${srcdir}/gotoh-${_realname}-${tag}"

  test -x ver || printf '#!/bin/sh\n\necho Windows\n' > ver

  PATH=.:$PATH make -j1 rebuild
}

package() {
  cd "${srcdir}/gotoh-${_realname}-${tag}"

  install -d "${pkgdir}${MINGW_PREFIX}/bin/"
  install connect.exe "${pkgdir}${MINGW_PREFIX}/bin/"

  install -d "${pkgdir}${MINGW_PREFIX}/share/doc/connect/"
  install doc/manual.html "${pkgdir}${MINGW_PREFIX}/share/doc/connect/"
  install doc/manual.txt "${pkgdir}${MINGW_PREFIX}/share/doc/connect/"
}
